package com.limingfeiyu.platform.management.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.limingfeiyu.common.web.PageTable;
import com.limingfeiyu.platform.management.entity.HospitalType;
import com.limingfeiyu.platform.management.mapper.HospitalTypeMapper;
import com.limingfeiyu.platform.management.service.IHospitalTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * <p>
 * 医院_类型 服务实现类
 * </p>
 *
 * @author 黎铭飞羽
 * @since 2024-04-12
 */
@Service
public class HospitalTypeServiceImpl extends ServiceImpl<HospitalTypeMapper, HospitalType> implements IHospitalTypeService {

    @Override
    public Page<HospitalType> pageList(PageTable<HospitalType> pageTable) {
        QueryWrapper<HospitalType> userQw = new QueryWrapper<>();
        if (pageTable.getParam() != null) {
            userQw.lambda();
        }
        Page<HospitalType> page = super.page(pageTable.getPage(), userQw);
        return page;
    }

    @Override
    public List<HospitalType> queryListByTypeTarget(String typeTarget) {
        LambdaQueryWrapper<HospitalType> lqwht = new LambdaQueryWrapper<>();
        lqwht.eq(HospitalType::getTypeTarget, typeTarget);
        return list(lqwht);
    }
}
